#include <iostream>
#include <unordered_map>
using namespace std;

typedef long long LL;

const int N = 2e6 + 10;
int n, m;
unordered_map<LL, int> mp;

int main()
{
	cin >> m;
	n = (m + 1) / 2;
	LL sum = 0; mp[0] = 0;
	for(int i = 1; i <= n; i++)
	{
		sum += i;
		if(mp.count(sum - m)) cout << mp[sum - m] + 1 << " " << i << endl;
		mp[sum] = i;
	}


	return 0;
}
